package org.applicationflow.command

import document.Document
import java.awt.event.{ActionEvent, KeyEvent}
import javax.swing.{KeyStroke, AbstractAction, Action}

import org.applicationflow.utils.ParameterChecker._

object Command {

  def apply[D <: Document]( id : CommandId, description : String, action: D => Unit ) = new Command( description, action, null, null, null, false )
}

case class Command[D <: Document](id : CommandId,
                  description: String,
                  action: D => Object,
                  undoAction: (D, Object) => Object,
                  redoAction: (D, Object) => Object,
                  canUndo : D => Boolean,
                  clearUndoQueue: Boolean) {

  requireNotNull( id, 'id )
  requireNotNull( description, 'description )
  requireNotNull( action, 'action )


}

